import { S } from '../../s';
import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { IPSDEChart } from './ipsdechart';
import { IPSDEChartLegend } from './ipsdechart-legend';
import { IPSDEChartSeries } from './ipsdechart-series';
import { IPSDEChartTitle } from './ipsdechart-title';
import { PSChartImpl } from './pschart-impl';
import { IPSLanguageRes } from '../../res/ipslanguage-res';

export class PSDEChartImpl extends PSChartImpl implements IPSDEChart {
  get baseOptionJOString(): string {
    return this.M.baseOptionJOString;
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get coordinateSystem():
    | 'XY'
    | 'POLAR'
    | 'RADAR'
    | 'PARALLEL'
    | 'SINGLE'
    | 'CALENDAR'
    | 'MAP'
    | 'NONE' {
    return this.M.coordinateSystem;
  }

  get emptyText(): string {
    return this.M.emptyText;
  }

  protected emptytextpslanguageres: IPSLanguageRes;
  getEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.emptytextpslanguageres ||
      (this.emptytextpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getEmptyTextPSLanguageRes,
        S._2b4,
      ) as IPSLanguageRes)
    );
  }

  get minorSortDir(): 'ASC' | 'DESC' {
    return this.M.minorSortDir;
  }

  protected minorsortpsappdefield: IPSAppDEField;
  getMinorSortPSAppDEField(): IPSAppDEField | null {
    return (
      this.minorsortpsappdefield ||
      (this.minorsortpsappdefield = this.fillObjectModel(
        S._1,
        this.M.getMinorSortPSAppDEField,
        S._2b9,
      ) as IPSAppDEField)
    );
  }

  protected psdechartlegend: IPSDEChartLegend;
  getPSDEChartLegend(): IPSDEChartLegend | null {
    return (
      this.psdechartlegend ||
      (this.psdechartlegend = this.fillObjectModel(
        S._fe,
        this.M.getPSDEChartLegend,
        S._35e,
      ) as IPSDEChartLegend)
    );
  }

  protected psdechartserieses: IPSDEChartSeries[];
  getPSDEChartSerieses(): IPSDEChartSeries[] | null {
    return (
      this.psdechartserieses ||
      (this.psdechartserieses = this.fillChildListModel(
        this.M.getPSDEChartSerieses,
        S._119,
      ) as IPSDEChartSeries[])
    );
  }

  findPSDEChartSeries(objKey: any): IPSDEChartSeries | null {
    return this.getPSModel5(
      S._119,
      this.getPSDEChartSerieses(),
      objKey,
    ) as IPSDEChartSeries;
  }

  protected psdecharttitle: IPSDEChartTitle;
  getPSDEChartTitle(): IPSDEChartTitle | null {
    return (
      this.psdecharttitle ||
      (this.psdecharttitle = this.fillObjectModel(
        S._113,
        this.M.getPSDEChartTitle,
        S._35f,
      ) as IPSDEChartTitle)
    );
  }

  hasWFDataItems(): boolean {
    return this.M.hasWFDataItems;
  }
  get cls(): string {
    return 'PSDEChartImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._253 || cls == S._254) return true;
    return super.instanceof(cls);
  }
}
